import unittest
from yklx.lx3.Tools import Tools
from XTestRunner import HTMLTestRunner
if __name__ == '__main__':
    #生成日志
    run=unittest.defaultTestLoader.discover(start_dir='./',pattern='TestCase.py')
    Tools().log_info('info.txt','w+')

    #发送邮件
    with open('baogao.html','wb') as e:

        runner=HTMLTestRunner(stream=e,title='测试报告',language='zh-CN')
        runner.run(run)
        Tools().send_eamil('测试报告',['baogao.html','info.txt'])